/**
* Ejemplo básico
* Demostración sencilla de los modos de funcionamiento de un widget AppliCast(tm) 
* y de los manejadores de eventos.
*
* (c) 2009 ILERRED, S.L.
*/

//= require <prototype>
//= require <applicast/applicast>
//= require "basic"

//////////////////////////////////////////////////////
// Core Events
//////////////////////////////////////////////////////

var App = null;

/**
* onLoad
* Iniciamos nuestro objeto widget
*/
function onLoad() {
  App = new Widget();
}

function onLoad() {
  App = new Widget({fullscreen: true});
}

/**
* onUpKey
*/
function onUpKey(type) {
  if ( type && type == 1 )  
    Event.fire('keypress', {keyCode: Event.KEY_UP});
}

/**
* onDownKey
*/
function onDownKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_DOWN});
}

/**
* onRightKey
*/

function onRightKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_RIGHT});
}

/**
* onLeftKey
*/
function onLeftKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_LEFT});
}

/**
* onConfirmKey
*/
function onConfirmKey(type) {
  if ( type && type == 1 )
    Event.fire('keypress', {keyCode: Event.KEY_CONFIRM});
}

/**
* onRedKey
*/
function onRedKey() {
  Event.fire('keypress', {keyCode: Event.KEY_RED});
}

/**
* onBlueKey
*/
function onBlueKey() {
  Event.fire('keypress', {keyCode: Event.KEY_BLUE});
}

/**
* onGreenKey
*/
function onGreenKey() {
  Event.fire('keypress', {keyCode: Event.KEY_GREEN});
}

/**
* onYellowKey
*/
function onYellowKey() {
  Event.fire('keypress', {keyCode: Event.KEY_YELLOW});
}